<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ page session="false"%>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Athenaeum : Create an Organization</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<jsp:include page="../../assets/header.jsp" />

</head>
<body>
	<jsp:include page="../../assets/navbar-top.jsp" />
	<div class="page-wrap">
		<div class="container-fluid">
			<div class="row row-wrap">
				<div class="col-md-10 col-md-offset-1">
					<div class="row">
						<ol class="breadcrumb">
							<li><i class="fa fa-home"></i> <a
								href="${pageContext.request.contextPath}">Home</a></li>
							<li><i class="fa fa-cogs"></i> <a
								href="${pageContext.request.contextPath}/settings/organizations">Settings</a></li>
							<li class="active"><i class="fa fa-umbrella"></i>
								Organization</li>
						</ol>
					</div>
					<div class="row">
						<h1>Create an organization</h1>
						<ol class="steps">
							<li class="complete"><i class="fa fa-check fa-2x"></i> <strong
								class="step">Completed</strong> Set up a personal account</li>
							<li class="current"><i class="fa fa-umbrella fa-2x"></i> <strong
								class="step">Step 2:</strong> Set up the organization</li>
							<li><i class="fa fa-sitemap fa-2x"></i> <strong class="step">Step
									3:</strong> Set up the departments</li>
							<li><i class="fa fa-suitcase fa-2x"></i> <strong
								class="step">Step 4:</strong> Set up a project</li>
							<li><i class="fa fa-group fa-2x"></i> <strong class="step">Step
									5:</strong> Invite team members</li>
						</ol>
					</div>
					<div class="row row-wrap">
						<h4>Set up the organization</h4>
						<div class="col-md-8">
							<form:form modelAttribute="organization"
								action="${pageContext.request.contextPath}/account/organization/save"
								method="post" role="form">
								<form:hidden path="id" />
								<div class="form-group">
									<label for="title">Title</label>
									<form:input type="text" class="form-control" id="title"
										path="title" placeholder="Organization Name" />
									<span class="help-block">The organization will live at
										http://athenaeum.com/</span>
								</div>
								<div class="form-group">
									<label for="description">Description</label>
									<form:input type="text" class="form-control" id="description"
										path="description"
										placeholder="Short description of this organization" />
								</div>
								<div class="form-group">
									<label for="lead">Head of Organization</label>
									<form:select class="selectpicker show-tick" path="lead"
										id="lead" items="${allusers}" data-live-search="true"
										data-width="100%">
									</form:select>
								</div>
								<div class="form-group">
									<label for="email">Billing Email</label>
									<form:input type="email" class="form-control" id="email"
										path="email" placeholder="Organization Email" />
									<span class="help-block">Receipts will be sent here</span>
								</div>
								<c:if test="${empty organization.id}">
									<button type="submit" class="btn btn-primary">Create
										Organization</button>
								</c:if>
								<c:if test="${not empty organization.id}">
									<button type="submit" class="btn btn-primary">Update
										Organization</button> &nbsp; &nbsp; <a
										href="${pageContext.request.contextPath}/account/organization/${organization.id}/department/index"
										class="btn btn-primary pull-right">View Departments</a>
								</c:if>
							</form:form>
						</div>
						<div class="col-md-4"></div>
					</div>
					<div class="row row-wrap"></div>
				</div>
			</div>
		</div>
	</div>
	<jsp:include page="../../assets/footer.jsp" />
	<script type="text/javascript">
		$(document).ready(function() {
			$('.selectpicker').selectpicker();
		});
	</script>
</body>
</html>

